<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>链接</title>
<style>
body { font-size:14px; margin:10px; font-family:Arial, Helvetica, sans-serif; }
div, span, ul, li, h1, h2, h3{ overflow:hidden; margin:0; padding:0; }
a { color:#0000FF; }
a:active { color:#FF6600; }

.mod {}
.mod ul { line-height:20px; }
.mod li { word-spacing:5px; font-size:13px; }
.mod h2 { color:#f00; font-size:14px;margin:5px 0 5px 0; }
.mod ul b { font-size:14px; margin:0 10px 0 0; }

.system_data { font-size:13px; color:#666666; margin:5px 0 0 0; word-spacing:1px;}
</style>

</head>
<body>


<?php
$link_tree = '';
foreach ($tree as $mod) :

	$link_tree .= "<div class=\"mod\"><h2>{$mod['info']['name']}</h2><ul>\r\n";

	// 链接分类
	foreach ($mod['data'] as $cat) :
		$link_tree .= "\r\n<li><b>{$cat['info']['name']}</b>\r\n";

		// 链接
		foreach ($cat['data'] as $id => $item) :
			// 是链接还是文字
			$link_tree .= $item['url'] != '' ? "<a href=\"./?m=link&a=go&id=$id\" itemid=\"$id\" title=\"[{$item['hits']}] {$item['url']}\">{$item['title']}</a>" : "<span itemid=\"$id\" title=\"ID:$id\">{$item['title']}</span>";
			// 子链接
			if(!empty($item['children'])) :
				$child_arr = array();
				foreach ($item['children'] as $id => $child) :
					$child_arr[] = "<a href=\"./?m=link&a=go&id=$id\" itemid=\"$id\" title=\"[{$child['hits']}] {$child['url']}\">{$child['title']}</a>";
				endforeach;
				$link_tree .= "[".implode(',', $child_arr)."]";
			endif;
			// 链接空隙
			$link_tree .= "\r\n";
		endforeach;

		$link_tree .= '</li>';
	endforeach;

	$link_tree .= '</ul></div>';

endforeach;

echo $link_tree;
?>

<div class="system_data">
	<?php
		$controller_get = new controller_get();
		echo $controller_get->action_login_status();
		echo ' / 记事:'.$controller_get->action_notes_count();
		echo ' / 点击:'.$controller_get->action_link_hits();
	?>
	/
	<?php echo date('H:i:s'); ?>
	/
	<?php echo number_format((microtime(true) - TIME_START_ALL) * 1000, 1)?>ms
</div>

</body>
</html>
